package com.tensquare.friend.dao;

import com.tensquare.friend.pojo.NoFriend;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

public interface NoFriendDao extends JpaRepository<NoFriend,String> {
    //1.根据userid以及friendid查询nofriend
    @Query(nativeQuery=true,value="select * from tb_nofriend where userid=?1 and friendid=?2")
    NoFriend findByIdAndFriendId(String userid,String friendid);
    //2.根据userid以及friend进行删除
    @Modifying
    @Query(nativeQuery=true,value="delete from tb_nofriend where userid=?1 and friendid=?2")
    void deleteByIdAndFriendid(String id, String friendid);
}
